CFLAGS += -I..

ifneq ($(KERNELRELEASE),)
	obj-m := ext2_fcp.o

	ext2_fcp-y := balloc.o 
	ext2_fcp-y += dir.o 
	ext2_fcp-y += file.o
	ext2_fcp-y += fsync.o
	ext2_fcp-y += ialloc.o
	ext2_fcp-y += inode.o
	ext2_fcp-y += ioctl.o
	ext2_fcp-y += namei.o
	ext2_fcp-y += super.o
	ext2_fcp-y += symlink.o

#	ext2_fcp-$(CONFIG_EXT2_FS_XATTR)     += xattr.o xattr_user.o xattr_trusted.o
#	ext2_fcp-$(CONFIG_EXT2_FS_POSIX_ACL) += acl.o
#	ext2_fcp-$(CONFIG_EXT2_FS_SECURITY)  += xattr_security.o
#	ext2_fcp-$(CONFIG_EXT2_FS_XIP)       += xip.o
	ext2_fcp-y += xattr.o xattr_user.o xattr_trusted.o
	ext2_fcp-y += acl.o
	ext2_fcp-y += xattr_security.o
	ext2_fcp-y += xip.o
else
	KERNELDIR ?= /lib/modules/$(shell uname -r)/build
	PWD := $(shell pwd)
default:
	$(MAKE) -C $(KERNELDIR) M=$(PWD) modules -Wall
endif

clean:
	rm Module.symvers -f
	rm *.mod.c
	rm *.o -f
	rm *.ko -f
